import request from '@/utils/request'

// 查询上位机数据列表
export function listData(query) {
  return request({
    url: '/device/data/list',
    method: 'get',
    params: query
  })
}
// 查询上位机历史数据列表
export function listDataHistory(query) {
  return request({
    url: '/device/data/listHistory',
    method: 'get',
    params: query
  })
}
// 查询上位机数据详细
export function getData(id) {
  return request({
    url: '/device/data/' + id,
    method: 'get'
  })
}

// 新增上位机数据
export function addData(data) {
  return request({
    url: '/device/data',
    method: 'post',
    data: data
  })
}

// 修改上位机数据
export function updateData(data) {
  return request({
    url: '/device/data',
    method: 'put',
    data: data
  })
}

// 删除上位机数据
export function delData(id) {
  return request({
    url: '/device/data/' + id,
    method: 'delete'
  })
}
